<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/manage/system/pageBase.jsp" %>
<%@ page info="案例列表" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro"%>
<form action="<%=path%>/manage/case" method="post">
    <div style="height:auto!important;height:550px;min-height:550px;">
        <h3 style="border-bottom: 1px solid #D7D7D7;color: #666666;font-size: 28px;padding-bottom: 20px;margin-bottom: 30px;">
            <%=getServletInfo()%>
            <shiro:hasPermission name="case:toAdd">
                <a href="toAdd" class="btn btn-primary"
                   style="padding: 2px 15px;float:right;">
                    <i class="icon-plus "></i>新增
                </a>
            </shiro:hasPermission>
        </h3>

        <div class="filter">
        
                
            <div style="float: left">
        	 	<input type="text" value="${e.caseName}" class="input-medium search-query" name="caseName" placeholder="案例名称"/>
        	 
                <select id="typeId" name="typeId">
                    <option value="">所属分类</option>
                    <c:forEach var="item" items="<%=SystemManage.getInstance().getCaseType()%>">
                        <option value="${item.id}" <c:if test="${e.typeId eq item.id}">selected="selected" </c:if>>${item.name}</option>
                    </c:forEach>
                </select>
                
 				<select id="recomment" name="recomment">
                    <option value="">是否首页推荐</option>
                    <option value="1" <c:if test="${e.recomment eq '1'}"> selected="selected"</c:if>  >是</option>
                    <option value="0"  <c:if test="${e.recomment eq '0'}"> selected="selected"</c:if> >否</option>
                </select>
                
                <button method="selectList" class="btn btn-info" style="padding:0px 5px;margin-top: -4px;"
                        onclick="selectList(this)">
                    <i class="icon-search"></i>查询
                </button>
                
            </div>
        </div>

        <table class="table table-bordered table-hover table-striped">
            <tr>
                <th width="50">序号</th>
                <th>案例名称</th>
                <th>所属分类</th>
                <th>图片</th>
                <th>是否首页推荐</th>
                <th>关联链接</th>
                <th>案例介绍</th>
                <th width="200">操作</th>
            </tr>
            
            <c:forEach var="item" items="${pager.list}">
                <tr>
                    <!-- 
                    <td><input type="checkbox" name="ids"
                               value="${item.id}"/></td>
                      -->          
                    <td>${item.id}</td>
                    <td>${item.caseName}</td>
                    <td>
                        <c:forEach var="caseType" items="<%=SystemManage.getInstance().getCaseType()%>">
                            <c:if test="${item.typeId eq caseType.id}">
                                ${caseType.name}
                            </c:if>
                        </c:forEach>
                    </td>
                    <td><a href="<%=SystemManage.getInstance().getSystemSetting().getImageRootPath()%>${item.image}" target="_blank">
                        <img  src="<%=SystemManage.getInstance().getSystemSetting().getImageRootPath()%>${item.image}" width="20px" height="20px"></a></td>
                    <td>
                    	<c:if test="${item.recomment eq '1'}">是</c:if>
                    	<c:if test="${item.recomment eq '0'}">否</c:if>
                    </td>
                    <td>${item.linkUrl}</td>
                    <td>${item.introduce}</td>
                    <td>
                        <shiro:hasPermission name="case:toEdit">
                            <a href="toEdit?id=${item.id}">编辑</a>&ensp;
                        </shiro:hasPermission>
                        <shiro:hasPermission name="case:toDel">
                            <a href="toDel?id=${item.id}">删除</a>
                        </shiro:hasPermission>
                    </td>
                </tr>
            </c:forEach>
            <tr>
                <td colspan="71" style="text-align: center;">
                    <%@ include file="/manage/system/page.jsp" %>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">
    //查询
    function selectList(obj) {

        var _form = $("form");
        _form.attr("action", $(obj).attr("method"));
        _form.submit();
    }
</script>

<%@ include file="/manage/system/baseFoot.jsp" %>
